package org.ice4apps.talk.dao;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * PublicNumber entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "public_number", catalog = "icetalk", uniqueConstraints = @UniqueConstraint(columnNames = { "user",
                                                                                                         "number" }))
public class PublicNumber implements java.io.Serializable {
    // Fields
    private String           id;
    private TalkUser         talkUser;
    private TalkOrganization talkOrganization;
    private TalkOffice       talkOffice;
    private TalkEnterprise   talkEnterprise;
    private String           number;
    private Long             creationdate;
    private Long             updationdate;

    // Constructors
    /** default constructor */
    public PublicNumber () {
    }

    /** minimal constructor */
    public PublicNumber (String id,
                         TalkUser talkUser,
                         TalkOrganization talkOrganization,
                         TalkOffice talkOffice,
                         TalkEnterprise talkEnterprise,
                         String number,
                         Long creationdate) {
        this.id = id;
        this.talkUser = talkUser;
        this.talkOrganization = talkOrganization;
        this.talkOffice = talkOffice;
        this.talkEnterprise = talkEnterprise;
        this.number = number;
        this.creationdate = creationdate;
    }

    /** full constructor */
    public PublicNumber (String id,
                         TalkUser talkUser,
                         TalkOrganization talkOrganization,
                         TalkOffice talkOffice,
                         TalkEnterprise talkEnterprise,
                         String number,
                         Long creationdate,
                         Long updationdate) {
        this.id = id;
        this.talkUser = talkUser;
        this.talkOrganization = talkOrganization;
        this.talkOffice = talkOffice;
        this.talkEnterprise = talkEnterprise;
        this.number = number;
        this.creationdate = creationdate;
        this.updationdate = updationdate;
    }

    // Property accessors
    @Id
    @Column(name = "id", unique = true, nullable = false, length = 36)
    public String getId () {
        return this.id;
    }

    public void setId (String id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "user", nullable = false)
    public TalkUser getTalkUser () {
        return this.talkUser;
    }

    public void setTalkUser (TalkUser talkUser) {
        this.talkUser = talkUser;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "organization", nullable = false)
    public TalkOrganization getTalkOrganization () {
        return this.talkOrganization;
    }

    public void setTalkOrganization (TalkOrganization talkOrganization) {
        this.talkOrganization = talkOrganization;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "office", nullable = false)
    public TalkOffice getTalkOffice () {
        return this.talkOffice;
    }

    public void setTalkOffice (TalkOffice talkOffice) {
        this.talkOffice = talkOffice;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "enterprise", nullable = false)
    public TalkEnterprise getTalkEnterprise () {
        return this.talkEnterprise;
    }

    public void setTalkEnterprise (TalkEnterprise talkEnterprise) {
        this.talkEnterprise = talkEnterprise;
    }

    @Column(name = "number", nullable = false, length = 32)
    public String getNumber () {
        return this.number;
    }

    public void setNumber (String number) {
        this.number = number;
    }

    @Column(name = "creationdate", nullable = false)
    public Long getCreationdate () {
        return this.creationdate;
    }

    public void setCreationdate (Long creationdate) {
        this.creationdate = creationdate;
    }

    @Column(name = "updationdate")
    public Long getUpdationdate () {
        return this.updationdate;
    }

    public void setUpdationdate (Long updationdate) {
        this.updationdate = updationdate;
    }
}